package base.thread.saleTicket;

public class Consumer implements Runnable {
	private Ticket ticket;

	public Consumer(Ticket ticket) {
		this.ticket = ticket;
	}

	public void run() {
		while (true) {
			ticket.getConsumer();
			if (ticket.ticketNum <= 0) {
				System.out.println("售票窗口已关闭,请明天再来!");
				break;
			}
		}
	}
}
